package com.tree.validationdemo.entity;

import com.tree.validationdemo.constraint.Gender;
import com.tree.validationdemo.group.Create;
import com.tree.validationdemo.group.Update;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * @author zhong
 * @version 1
 * @date 2022/04/10
 * @contact 1478168700@qq.com
 **/
@Data
public class User implements Serializable {

    private static final long serialVersionUID = -9054337612931858264L;

    @NotEmpty(groups = {Update.class})
    private Long id;

    @NotBlank(groups = {Create.class, Update.class},message = "userName不能为空")
    private String userName;

    private String password;

    @Gender(groups = {Create.class,Update.class})
    private String gender;
}
